// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()
exports.main = async(event, context) => {
    const {
        openidValue,
        content
    } = event;
    try {
        console.log(event.openidValue)
        const result = await cloud.openapi.subscribeMessage.send({
            touser: event.openidValue,
            page: 'index',
            lang: 'zh_CN',
            data: event.content,
            templateId: 'rrUsqwtl312iyUEFO-Xv3teLOjE8WQ00Xea69OV_V-4',
        })
        console.log(result)
        return result
    } catch (err) {
        console.log(err)
        return err
    }
}